\(\int \frac {d+e x}{\sqrt {a^2+2 a b x+b^2 x^2}} \, dx\) [1590]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 26, antiderivative size = 69 \[ \int \frac {d+e x}{\sqrt {a^2+2 a b x+b^2 x^2}} \, dx=\frac {e \sqrt {a^2+2 a b x+b^2 x^2}}{b^2}+\frac {(b d-a e) (a+b x) \log (a+b x)}{b^2 \sqrt {a^2+2 a b x+b^2 x^2}} \]

[Out]

(-a*e+b*d)*(b*x+a)*ln(b*x+a)/b^2/((b*x+a)^2)^(1/2)+e*((b*x+a)^2)^(1/2)/b^2

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 69, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.115, Rules used = {654, 622, 31} \[ \int \frac {d+e x}{\sqrt {a^2+2 a b x+b^2 x^2}} \, dx=\frac {(a+b x) (b d-a e) \log (a+b x)}{b^2 \sqrt {a^2+2 a b x+b^2 x^2}}+\frac {e \sqrt {a^2+2 a b x+b^2 x^2}}{b^2} \]

[In]

Int[(d + e*x)/Sqrt[a^2 + 2*a*b*x + b^2*x^2],x]

[Out]

(e*Sqrt[a^2 + 2*a*b*x + b^2*x^2])/b^2 + ((b*d - a*e)*(a + b*x)*Log[a + b*x])/(b^2*Sqrt[a^2 + 2*a*b*x + b^2*x^2
])

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 622

Int[1/Sqrt[(a_) + (b_.)*(x_) + (c_.)*(x_)^2], x_Symbol] :> Dist[(b/2 + c*x)/Sqrt[a + b*x + c*x^2], Int[1/(b/2
+ c*x), x], x] /; FreeQ[{a, b, c}, x] && EqQ[b^2 - 4*a*c, 0]

Rule 654

Int[((d_.) + (e_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[e*((a + b*x + c*x^2)^(p +
 1)/(2*c*(p + 1))), x] + Dist[(2*c*d - b*e)/(2*c), Int[(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, p}
, x] && NeQ[2*c*d - b*e, 0] && NeQ[p, -1]

Rubi steps \begin{align*} \text {integral}& = \frac {e \sqrt {a^2+2 a b x+b^2 x^2}}{b^2}+\frac {\left (2 b^2 d-2 a b e\right ) \int \frac {1}{\sqrt {a^2+2 a b x+b^2 x^2}} \, dx}{2 b^2} \\ & = \frac {e \sqrt {a^2+2 a b x+b^2 x^2}}{b^2}+\frac {\left (\left (2 b^2 d-2 a b e\right ) \left (a b+b^2 x\right )\right ) \int \frac {1}{a b+b^2 x} \, dx}{2 b^2 \sqrt {a^2+2 a b x+b^2 x^2}} \\ & = \frac {e \sqrt {a^2+2 a b x+b^2 x^2}}{b^2}+\frac {(b d-a e) (a+b x) \log (a+b x)}{b^2 \sqrt {a^2+2 a b x+b^2 x^2}} \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(177\) vs. \(2(69)=138\).

Time = 0.45 (sec) , antiderivative size = 177, normalized size of antiderivative = 2.57 \[ \int \frac {d+e x}{\sqrt {a^2+2 a b x+b^2 x^2}} \, dx=\frac {(2 a+b x) \left (-b e x \left (\sqrt {a^2} b x+a \left (\sqrt {a^2}-\sqrt {(a+b x)^2}\right )\right )-2 (-b d+a e) \left (-a^2-a b x+\sqrt {a^2} \sqrt {(a+b x)^2}\right ) \text {arctanh}\left (\frac {b x}{\sqrt {a^2}-\sqrt {(a+b x)^2}}\right )\right )}{b^2 \left (\sqrt {a^2}-\sqrt {(a+b x)^2}\right ) \left (\sqrt {a^2} b x+a \left (\sqrt {a^2}-\sqrt {(a+b x)^2}\right )\right )} \]

[In]

Integrate[(d + e*x)/Sqrt[a^2 + 2*a*b*x + b^2*x^2],x]

[Out]

((2*a + b*x)*(-(b*e*x*(Sqrt[a^2]*b*x + a*(Sqrt[a^2] - Sqrt[(a + b*x)^2]))) - 2*(-(b*d) + a*e)*(-a^2 - a*b*x +
Sqrt[a^2]*Sqrt[(a + b*x)^2])*ArcTanh[(b*x)/(Sqrt[a^2] - Sqrt[(a + b*x)^2])]))/(b^2*(Sqrt[a^2] - Sqrt[(a + b*x)
^2])*(Sqrt[a^2]*b*x + a*(Sqrt[a^2] - Sqrt[(a + b*x)^2])))

Maple [A] (verified)

Time = 2.52 (sec) , antiderivative size = 45, normalized size of antiderivative = 0.65

method result size
default \(-\frac {\left (b x +a \right ) \left (\ln \left (b x +a \right ) a e -\ln \left (b x +a \right ) b d -b e x \right )}{\sqrt {\left (b x +a \right )^{2}}\, b^{2}}\) \(45\)
risch \(\frac {\sqrt {\left (b x +a \right )^{2}}\, e x}{\left (b x +a \right ) b}-\frac {\sqrt {\left (b x +a \right )^{2}}\, \left (a e -b d \right ) \ln \left (b x +a \right )}{\left (b x +a \right ) b^{2}}\) \(59\)

[In]

int((e*x+d)/((b*x+a)^2)^(1/2),x,method=_RETURNVERBOSE)

[Out]

-(b*x+a)*(ln(b*x+a)*a*e-ln(b*x+a)*b*d-b*e*x)/((b*x+a)^2)^(1/2)/b^2

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.35 \[ \int \frac {d+e x}{\sqrt {a^2+2 a b x+b^2 x^2}} \, dx=\frac {b e x + {\left (b d - a e\right )} \log \left (b x + a\right )}{b^{2}} \]

[In]

integrate((e*x+d)/((b*x+a)^2)^(1/2),x, algorithm="fricas")

[Out]

(b*e*x + (b*d - a*e)*log(b*x + a))/b^2

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 134 vs. \(2 (46) = 92\).

Time = 0.81 (sec) , antiderivative size = 134, normalized size of antiderivative = 1.94 \[ \int \frac {d+e x}{\sqrt {a^2+2 a b x+b^2 x^2}} \, dx=\begin {cases} \frac {\left (\frac {a}{b} + x\right ) \left (- \frac {a e}{b} + d\right ) \log {\left (\frac {a}{b} + x \right )}}{\sqrt {b^{2} \left (\frac {a}{b} + x\right )^{2}}} + \frac {e \sqrt {a^{2} + 2 a b x + b^{2} x^{2}}}{b^{2}} & \text {for}\: b^{2} \neq 0 \\\frac {2 d \sqrt {a^{2} + 2 a b x} + \frac {e \left (- a^{2} \sqrt {a^{2} + 2 a b x} + \frac {\left (a^{2} + 2 a b x\right )^{\frac {3}{2}}}{3}\right )}{a b}}{2 a b} & \text {for}\: a b \neq 0 \\\frac {d x + \frac {e x^{2}}{2}}{\sqrt {a^{2}}} & \text {otherwise} \end {cases} \]

[In]

integrate((e*x+d)/((b*x+a)**2)**(1/2),x)

[Out]

Piecewise(((a/b + x)*(-a*e/b + d)*log(a/b + x)/sqrt(b**2*(a/b + x)**2) + e*sqrt(a**2 + 2*a*b*x + b**2*x**2)/b*
*2, Ne(b**2, 0)), ((2*d*sqrt(a**2 + 2*a*b*x) + e*(-a**2*sqrt(a**2 + 2*a*b*x) + (a**2 + 2*a*b*x)**(3/2)/3)/(a*b
))/(2*a*b), Ne(a*b, 0)), ((d*x + e*x**2/2)/sqrt(a**2), True))

Maxima [A] (verification not implemented)

none

Time = 0.21 (sec) , antiderivative size = 52, normalized size of antiderivative = 0.75 \[ \int \frac {d+e x}{\sqrt {a^2+2 a b x+b^2 x^2}} \, dx=\frac {d \log \left (x + \frac {a}{b}\right )}{b} - \frac {a e \log \left (x + \frac {a}{b}\right )}{b^{2}} + \frac {\sqrt {b^{2} x^{2} + 2 \, a b x + a^{2}} e}{b^{2}} \]

[In]

integrate((e*x+d)/((b*x+a)^2)^(1/2),x, algorithm="maxima")

[Out]

d*log(x + a/b)/b - a*e*log(x + a/b)/b^2 + sqrt(b^2*x^2 + 2*a*b*x + a^2)*e/b^2

Giac [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 44, normalized size of antiderivative = 0.64 \[ \int \frac {d+e x}{\sqrt {a^2+2 a b x+b^2 x^2}} \, dx=\frac {e x \mathrm {sgn}\left (b x + a\right )}{b} + \frac {{\left (b d \mathrm {sgn}\left (b x + a\right ) - a e \mathrm {sgn}\left (b x + a\right )\right )} \log \left ({\left | b x + a \right |}\right )}{b^{2}} \]

[In]

integrate((e*x+d)/((b*x+a)^2)^(1/2),x, algorithm="giac")

[Out]

e*x*sgn(b*x + a)/b + (b*d*sgn(b*x + a) - a*e*sgn(b*x + a))*log(abs(b*x + a))/b^2

Mupad [B] (verification not implemented)

Time = 9.79 (sec) , antiderivative size = 79, normalized size of antiderivative = 1.14 \[ \int \frac {d+e x}{\sqrt {a^2+2 a b x+b^2 x^2}} \, dx=\frac {e\,\sqrt {a^2+2\,a\,b\,x+b^2\,x^2}}{b^2}+\frac {d\,\ln \left (a+b\,x+\sqrt {{\left (a+b\,x\right )}^2}\right )}{b}-\frac {a\,b\,e\,\ln \left (a\,b+\sqrt {{\left (a+b\,x\right )}^2}\,\sqrt {b^2}+b^2\,x\right )}{{\left (b^2\right )}^{3/2}} \]

[In]

int((d + e*x)/((a + b*x)^2)^(1/2),x)

[Out]

(e*(a^2 + b^2*x^2 + 2*a*b*x)^(1/2))/b^2 + (d*log(a + b*x + ((a + b*x)^2)^(1/2)))/b - (a*b*e*log(a*b + ((a + b*
x)^2)^(1/2)*(b^2)^(1/2) + b^2*x))/(b^2)^(3/2)